
#include "MenuState.h"
#include "ResourceManager.h"
#include "GameEngine.h"
#include "GamePlayState.h"

CMenuState::CMenuState(GameStateId gameId, CGameEngine* gameEngine) : CGameState(gameId, gameEngine)
{
	this->m_background = new CObject(D3DXVECTOR2(0, 0));
}

void CMenuState::Init()
{
	this->m_background->Init();
	this->m_camera = new CCamera();
	CGameState::Init();
}

void CMenuState::Update(float gameTime, CInput* input)//DIK_K
{
	if (input->KeyDown(DIK_K))
	{
		//m_gameEngine->m_nextState = new CGamePlayState(GAME_PLAY, this->m_gameEngine);
		//m_gameEngine->m_nextState->Init();
		a = TRUE;
	} else a = FALSE;


	this->m_background->Update(gameTime, input);
	//this->m_camera->Update(input);
	CGameState::Update(gameTime, input);
}

void CMenuState::Draw(LPD3DXSPRITE spriteHandler)
{
	if (a)
		this->m_background->Draw(spriteHandler, this->m_camera);
}

